import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.Timer;


public class Human {
	static BufferedImage humanImage;
	static{
		try{
			humanImage = ImageIO.read(new File("res/human.png"));
		} catch(IOException e){
			e.printStackTrace();
		}
	}
	private Ellipse2D head;
	private Rectangle2D body;
	private Line2D leftArm;
	private Line2D rightArm;
	private Line2D leftLeg;
	private Line2D rightLeg;
	int x, y;
	public Human(int x, int y, Timer t){
		this.x = x;
		this.y = y;
		this.head = new Ellipse2D.Double(x, y, 10, 20);
		this.body = new Rectangle2D.Double(x-3, y+20, 16, 40);
		this.leftArm = new Line2D.Double(x-3, y+20, x-13, y+10);
		this.rightArm = new Line2D.Double(x + 13, y+20, x+23, y+10);
	}
	
	public void paint(Graphics2D g){
		Color prevColor = g.getColor();
		g.rotate(Math.PI/4, x, y);
		g.setColor(Color.WHITE);
	/*	g.fill(head);
		g.fill(body);
		g.draw(leftArm);
		g.draw(rightArm);*/
		g.drawImage(humanImage, x, y, null);
		g.setColor(prevColor);
		g.rotate(-Math.PI/4, x, y);
	}
}
